
#ifndef _TTG_SERVICES_SUBSCRIBERS_
#define _TTG_SERVICES_SUBSCRIBERS_
#include "Common/Definitions.h"

#include "Common/Errors.h"
#include "EventTypes.h"

namespace ttg
{
	namespace services
	{
		//Represents class, which can subscribe to some events.
		class Subscriber
		{
			public:
				virtual ~Subscriber() {};
		};

		//Contains information about one subscription.
		class SubscriberInfo
		{
			private:
				Subscriber *ss;
				void (*d)(Subscriber *ss, Event *ev);
			public:
				//Created SubscriberInfo for given params.
				//Note: they will NOT be released by ~SubscriberInfo().
				SubscriberInfo(Subscriber *ss, void (*d)(Subscriber *ss, Event *ev));
				//Sends given event to associated subscriber.
				void sendEvent(Event *ev);
		};
	}
}

#endif
